import urllib.request
url = 'https://www.douban.com/'
req = urllib.request.Request (url)
req.add_header('User-Agent','Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36')
result = urllib.request.urlopen(req).read()
print(result.decode('utf-8'))